/*
* pps_bom
*/
package com.pitop.bom.api;

import com.pitop.bom.entity.BomDetail;
import com.pitop.bom.vo.BomDetailVO;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * bom明细 api请求熔断器
 *
 * @author berton
 */
@FeignClient(value = "pps-cloud-provider", fallback = BomDetailFeignApiImpl.class)
public interface BomDetailFeignApi {
    /**
     * 查询BomDetail一个详情信息
     *
     * @param id
     * @param code 编码
     * @return BomDetail
     */
    @GetMapping(value = "/bomDetail/load")
    BomDetail load(@RequestParam("id") Long id, @RequestParam("code") String code);

    /**
     * 查询BomDetail一个详情信息
     *
     * @param id
     * @param code 编码
     * @return BomDetail
     */
    @GetMapping(value = "/bomDetail/get")
    BomDetail get(@RequestParam("id") Long id, @RequestParam("code") String code);

    /**
     * 根据条件id查询BomDetail一个详情信息
     *
     * @param id
     * @return BomDetail
     */
    @GetMapping(value = "/bomDetail/load/id/{id}")
    BomDetail loadById(@RequestParam("id") Long id);

    /**
     * 根据条件code查询BomDetail一个详情信息
     *
     * @param code 编码
     * @return BomDetail
     */
    @GetMapping(value = "/bomDetail/load/code/{code}")
    BomDetail loadByCode(@RequestParam("code") String code);

    /**
     * 根据条件id查询BomDetail一个详情信息
     *
     * @param id
     * @return BomDetail
     */
    @GetMapping(value = "/bomDetail/get/id/{id}")
    BomDetail getById(@RequestParam("id") Long id);

    /**
     * 根据条件code查询BomDetail一个详情信息
     *
     * @param code 编码
     * @return BomDetail
     */
    @GetMapping(value = "/bomDetail/get/code/{code}")
    BomDetail getByCode(@RequestParam("code") String code);

    /**
     * 删除BomDetail
     */
    @DeleteMapping("/bomDetail/delete")
    void delete(@RequestParam("id") Long id, @RequestParam("code") String code);


    /**
     * 查询BomDetail信息集合
     *
     * @return 分页对象
     */
    @PostMapping(value = "/bomDetail/list")
    List<BomDetail> list(@RequestBody BomDetail bomDetail, @RequestParam("curPage") int curPage, @RequestParam("pageSize") int pageSize);


    /**
     * 查询BomDetail信息集合
     *
     * @return 分页对象
     */
    @GetMapping(value = "/bomDetail/list/by")
    List<BomDetail> listByPk(@RequestParam("id") Long id, @RequestParam("code") String code, @RequestParam("curPage") int curPage, @RequestParam("pageSize") int pageSize);


    /**
     * 统计BomDetail信息数量根据主键
     *
     * @return 总条数
     */
    @GetMapping(value = "/bomDetail/count/by")
    Integer count(@RequestParam("id") Long id, @RequestParam("code") String code);

    /**
     * 统计BomDetail信息数量
     *
     * @return 总条数
     */
    @PostMapping(value = "/bomDetail/count")
    Integer count(@RequestBody BomDetail bomDetail);


    /**
     * 创建BomDetail
     *
     * @return BomDetail
     */
    @PostMapping("/bomDetail/build")
    BomDetail build(@RequestBody BomDetail bomDetail, @RequestParam("account") String account, @RequestParam("code") String code);

    /**
     * 创建BomDetail
     *
     * @return BomDetail
     */
    @PostMapping("/bomDetail/save")
    BomDetail save(@RequestBody List<BomDetailVO> bomDetailVOs, @RequestParam("account") String account, @RequestParam("code") String code);


    /**
     * 修改BomDetail
     *
     * @return BomDetail
     */
    @PutMapping("/bomDetail/modify")
    BomDetail modify(@RequestBody BomDetail bomDetail, @RequestParam("account") String account, @RequestParam("code") String code);

    /***
     * 修改组件状态
     *
     * @return Assembly
     */
    @PutMapping("/bomDetail/updateState")
    BomDetail updateState(@RequestParam("code") String code, @RequestParam("state") String state);

}
